

export const add = (a: number, b: number) => a + b


export const serverfun = () => {

  let eventSource = new EventSource('http://localhost:3000/api/events');
  console.log('instance', eventSource);
  eventSource.onopen = () => {
    console.log('onopen已连接');
  }

  eventSource.onmessage = (event) => {
    console.log('onmessage', event);
  }

}

export const connWebSocket = () => {
  return new WebSocket('ws://localhost:9000');

}

